package com.example.helloworld;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.Toast;

public class EventHandler extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_event_handler);
		
        final Button button =	(Button)findViewById(R.id.changeImage);
        button.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				Toast.makeText(getApplicationContext(), "button click!!!", Toast.LENGTH_LONG).show();
				
				Intent intent =	new Intent(getApplicationContext(), EventHandler.class);
				startActivity(intent);
			}
        });
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.event_handler, menu);
		return true;
	}
	
	public void callNaver(View view) {
		Intent intent =	new Intent(Intent.ACTION_VIEW, Uri.parse("http://m.naver.com"));
		startActivity(intent);
	}
	
	public void callReturn(View view) {
		Toast.makeText(getApplicationContext(), "return", Toast.LENGTH_LONG).show();
		finish();
	}
	
	public void callPhone(View view) {
		Intent intent =	new Intent(Intent.ACTION_VIEW, Uri.parse("tel:010-8236-1429"));
		startActivity(intent);
	}
	
}
